home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagg_m.zip / MISC.SWG / 0069_Do Nothing!.pas < prev    next >
Pascal/Delphi Source File  |  1994-01-27  |  2KB  |  54 lines

  1. {
  2. >Well, Uh, I meant creating pascal compiled files, and basic compiled
  3. >files and putting them in a BAT file so that they will execute in order.
  4.  
  5. >Oh and, uh , how to do you compile programs in tp 7 so that they are not
  6. > broken (or shut off in the middle if someone pressed control break)?
  7. >I can't stop the control break thing...
  8.  
  9. A common question.  Here is my solution:
  10.  
  11. {****************************************************************************
  12.  * Procedure ..... DoNothing
  13.  * Purpose ....... A do-nothing procedure to intercept interrupts and stop
  14.  *                 them from happening.
  15.  * Parameters .... None
  16.  * Returns ....... Nothing
  17.  * Notes ......... None
  18.  * Author ........ Martin Richardson
  19.  * Date .......... February 19, 1993
  20.  ****************************************************************************}
  21.  
  22. {$F+}
  23. PROCEDURE DoNothing; INTERRUPT;
  24. BEGIN
  25. END;
  26. {$F-}
  27.  
  28. {****************************************************************************
  29.  * Procedure ..... SetBreak()
  30.  * Purpose ....... To dis-allow CTRL-BREAKING out of a program.
  31.  * Parameters .... SetOn        False to turn CTRL-BREAK off
  32.  *                              True to turn it back on again
  33.  * Returns ....... Nothing
  34.  * Notes ......... Uses the procedure DoNothing above to remap INT 1Bh to.
  35.  * Author ........ Martin Richardson
  36.  * Date .......... February 19, 1993
  37.  ****************************************************************************}
  38. PROCEDURE SetBreak( SetOn: BOOLEAN );
  39. CONST Int1BSave : Pointer = NIL;
  40. BEGIN
  41.   IF NOT SetOn THEN BEGIN
  42.      GetIntVec($1B,Int1BSave);
  43.      SetIntVec($1B,Addr(DoNothing));
  44.   END ELSE
  45.       IF Int1BSave <> NIL THEN SetIntVec($1B,Int1BSave);
  46. END;
  47.  
  48. {
  49. However, this method will not prevent them from breaking out of the .BAT
  50. file you described above to link the programs together with!  (You will
  51. need a TSR to do that.)
  52. }
  53.  
  54.